home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / fse2x.frm < prev    next >
Text File  |  1995-05-07  |  7KB  |  216 lines

  1. VERSION 2.00
  2. Begin Form FSE2xForm 
  3.    Caption         =   "File Server Environment v2.x Services Test"
  4.    ClientHeight    =   3645
  5.    ClientLeft      =   1785
  6.    ClientTop       =   1830
  7.    ClientWidth     =   5385
  8.    Height          =   4050
  9.    Left            =   1725
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3645
  12.    ScaleWidth      =   5385
  13.    Top             =   1485
  14.    Width           =   5505
  15.    Begin Frame Frame1 
  16.       Caption         =   "Disk Cache Statistics"
  17.       Height          =   1935
  18.       Left            =   120
  19.       TabIndex        =   5
  20.       Top             =   960
  21.       Width           =   5175
  22.       Begin Label CacheHitsLabel 
  23.          Height          =   255
  24.          Left            =   2640
  25.          TabIndex        =   17
  26.          Top             =   1560
  27.          Width           =   1695
  28.       End
  29.       Begin Label CacheWritesLabel 
  30.          Height          =   255
  31.          Left            =   2640
  32.          TabIndex        =   16
  33.          Top             =   1320
  34.          Width           =   1695
  35.       End
  36.       Begin Label CacheReadsLabel 
  37.          Height          =   255
  38.          Left            =   2640
  39.          TabIndex        =   15
  40.          Top             =   1080
  41.          Width           =   1695
  42.       End
  43.       Begin Label DirtyCacheLabel 
  44.          Height          =   255
  45.          Left            =   2640
  46.          TabIndex        =   14
  47.          Top             =   840
  48.          Width           =   1695
  49.       End
  50.       Begin Label CacheSizeLabel 
  51.          Height          =   255
  52.          Left            =   2640
  53.          TabIndex        =   13
  54.          Top             =   600
  55.          Width           =   1695
  56.       End
  57.       Begin Label CacheBuffLabel 
  58.          Height          =   255
  59.          Left            =   2640
  60.          TabIndex        =   12
  61.          Top             =   360
  62.          Width           =   1695
  63.       End
  64.       Begin Label Label8 
  65.          Alignment       =   1  'Right Justify
  66.          Caption         =   "Cache hits:"
  67.          Height          =   255
  68.          Left            =   480
  69.          TabIndex        =   11
  70.          Top             =   1560
  71.          Width           =   1695
  72.       End
  73.       Begin Label Label7 
  74.          Alignment       =   1  'Right Justify
  75.          Caption         =   "Cache writes:"
  76.          Height          =   255
  77.          Left            =   480
  78.          TabIndex        =   10
  79.          Top             =   1320
  80.          Width           =   1695
  81.       End
  82.       Begin Label Label6 
  83.          Alignment       =   1  'Right Justify
  84.          Caption         =   "Cache reads:"
  85.          Height          =   255
  86.          Left            =   480
  87.          TabIndex        =   9
  88.          Top             =   1080
  89.          Width           =   1695
  90.       End
  91.       Begin Label Label5 
  92.          Alignment       =   1  'Right Justify
  93.          Caption         =   "Dirty cache buffers:"
  94.          Height          =   255
  95.          Left            =   480
  96.          TabIndex        =   8
  97.          Top             =   840
  98.          Width           =   1695
  99.       End
  100.       Begin Label Label4 
  101.          Alignment       =   1  'Right Justify
  102.          Caption         =   "Cache buffer size:"
  103.          Height          =   255
  104.          Left            =   480
  105.          TabIndex        =   7
  106.          Top             =   600
  107.          Width           =   1695
  108.       End
  109.       Begin Label Label3 
  110.          Alignment       =   1  'Right Justify
  111.          Caption         =   "Cache buffers:"
  112.          Height          =   255
  113.          Left            =   480
  114.          TabIndex        =   6
  115.          Top             =   360
  116.          Width           =   1695
  117.       End
  118.    End
  119.    Begin CommandButton CancelButton 
  120.       Caption         =   "&Cancel"
  121.       Height          =   375
  122.       Left            =   2880
  123.       TabIndex        =   4
  124.       Top             =   3120
  125.       Width           =   975
  126.    End
  127.    Begin ComboBox ServerNameBox 
  128.       Height          =   300
  129.       Left            =   1680
  130.       TabIndex        =   1
  131.       Top             =   480
  132.       Width           =   2655
  133.    End
  134.    Begin CommandButton OKButton 
  135.       Caption         =   "&OK"
  136.       Height          =   375
  137.       Left            =   1560
  138.       TabIndex        =   0
  139.       Top             =   3120
  140.       Width           =   975
  141.    End
  142.    Begin Label Label2 
  143.       Caption         =   "Select a NetWare 2.x file server:"
  144.       Height          =   255
  145.       Left            =   120
  146.       TabIndex        =   3
  147.       Top             =   120
  148.       Width           =   4695
  149.    End
  150.    Begin Label Label1 
  151.       Alignment       =   1  'Right Justify
  152.       Caption         =   "File Server:"
  153.       Height          =   255
  154.       Left            =   120
  155.       TabIndex        =   2
  156.       Top             =   480
  157.       Width           =   1455
  158.    End
  159. End
  160.  
  161. Sub Form_Unload (Cancel As Integer)
  162.     SetPreferredConnectionID (originalPrefConnID%)
  163. End Sub
  164.  
  165. Sub OKButton_Click ()
  166.     Dim cacheStats As DISK_CACHE_STATS
  167.  
  168.     connID% = GetPreferredConnectionID()
  169.     ccode% = CheckConsolePrivileges()
  170.     If (ccode% = SUCCESSFUL) Then
  171.         ccode% = GetDiskCacheStats(connID%, Len(cacheStats), cacheStats)
  172.         If (ccode% <> SUCCESSFUL) Then
  173.             MsgBox "Unable to get disk cache statistics.", MB_OK, "Error"
  174.         Else
  175.             CacheBuffLabel.Caption = Str$(cacheStats.cacheBufferCount)
  176.             CacheSizeLabel.Caption = Str$(cacheStats.cacheBufferSize)
  177.             DirtyCacheLabel.Caption = Str$(cacheStats.dirtyCacheBuffers)
  178.             CacheReadsLabel.Caption = Str$(cacheStats.cacheReadRequests)
  179.             CacheWritesLabel.Caption = Str$(cacheStats.cacheWriteRequests)
  180.             CacheHitsLabel.Caption = Str$(cacheStats.cacheHits)
  181.         End If
  182.     End If
  183. End Sub
  184.  
  185. Sub ServerNameBox_Change ()
  186.     ccode% = GetConnectionID(ServerNameBox.Text, connID%)
  187.     If (ccode% <> SUCCESSFUL) Then
  188.         MsgBox "Unable to get connection ID", MB_OK, "Error"
  189.     Else
  190.         SetPreferredConnectionID (connID%)
  191.     End If
  192. End Sub
  193.  
  194. Sub ServerNameBox_Click ()
  195.     ServerNameBox_Change
  196. End Sub
  197.  
  198. Sub CancelButton_Click ()
  199.     Unload FSE2xForm
  200. End Sub
  201.  
  202. Sub Form_Load ()
  203.     Dim fileServerName As String * 48
  204.  
  205.     fileServerName = GetDefaultFileServerName()
  206.     ServerNameBox.Text = fileServerName
  207.     
  208.     For connID% = 1 To 8
  209.         If (IsConnectionIDInUse(connID%) = 1) Then
  210.             GetFileServerName connID%, fileServerName
  211.             ServerNameBox.AddItem fileServerName
  212.         End If
  213.     Next connID%
  214. End Sub
  215.  
  216.